Applying Arithmetic Operations

Arithmetic operations can be applied to the scalar data that is available in the Analyze and Classify Measurements dialog.

In the Arithmetic Operation dialog, shown below, you can select a number of inputs and then write an expression to produce an output. The convention for identifying each input within an expression is simply 'A' for the first input, 'B' for the second input, 'C' for the third, and so on. For example, to get the sum of the first input and the second input, the expression would be 'A+B'. More complex expressions can also be written, such as 'D*[(A+B)+(2*A-1.8*B)]/C'. You can also include NumPy functionalities in an expression. For example, in the expression 'np.sin(A)+np.cos(B)', 'np.sin' and 'np.cos' refer to the 'sine' and 'cosine' functions of NumPy. NumPy is the fundamental package for scientific computing in Python.

Arithmetic Operation dialog

Arithmetic Operation dialog

The results of arithmetic operations are always set to ‘generic continuous’, which means that no measurement units are assigned. If required, you can assign a unit to the computed values (see Assigning Units to Scalar Data).
To avoid any wrapping of pixel values and for best precision, all calculations for arithmetic operations are done in float.
How to Apply an Arithmetic Operation
  1. Select the required table.

    Note Refer to the topic Importing Scalar Data for information about importing scalar data and Adding New Measurements for information about computing new measurements.

  2. Click the Arithmetic Arithmetic button.

    The Arithmetic Operation dialog appears.

  3. Select the required input(s) in the drop-down menu(s).

    If required, click the '+' button to add an input. Click the '-' button to remove an input.

    Note The convention for identifying each input is simply 'A' for the first input, 'B' for the second input, 'C' for the third, and so on.

  4. Write an expression to produce the required output.

    Note For example, to get the sum of the first input and the second input, the expression would be 'A+B'. More complex expressions can also be written, such as 'D*[(A+B)+(2*A-1.8*B)]/C'. You can also include NumPy functionalities in an expression. For example, in the expression 'np.sin(A)+np.cos(B)'.

  5. Select a scalar slot for the output in the Measurement title drop-down menu.

    Arithmetic Operation dialog

    To create a new slot with the output of the operation, choose 'Arithmetic result'. In this case, you can edit the title of the measurement.

    You can also overwrite any of the available slots.

  6. Click Compute.